Embodiments of the inventive subject matter generally relate to the field of computer networking, and, more particularly, to migrating an endpoint of an application session.
The Open Systems Interconnection (OSI) model is a conceptual model that logically partitions inter-system communication functionality into layers. The higher layers correspond to user level or near user level applications that uses the services provided by protocols of the lower layers. The applications access the lower layer services by calling Application Programming Interface (API) functions defined for an implementation of a lower layer protocol. For instance, an application running in a particular operating system will bind to an address and port, create a connection, communicate over the connection, and close the connection using functions of a sockets API provided by the operating system. Each of the socket API functions invokes program code that operates in accordance with the lower layer protocol, such as the transmission control protocol.
The transmission control protocol (TCP) is a connection-oriented transport layer protocol that provides reliable byte-stream delivery between two network hosts. The transmission control protocol (TCP) is coupled with the Internet Protocol (IP) and numerous other protocols as a suite of networking protocols. This suite of protocols is often referred to as a TCP/IP protocol suite. TCP/IP employs an abstraction of 4 layers similar to some of the layers in the Open Systems Interconnect (OSI) 7 layer reference model. Layer 4 of TCP/IP corresponds to layers 5-7 of the OSI reference mode. Although a TCP/IP protocol suite may include a network interface protocol (e.g., PPP or SLIP), the network interface layer (or data link layer) typically is not implemented by a TCP/IP stack (i.e., code implementing the TCP/IP protocol) because the TCP/IP stack relies upon another protocol (e.g., Ethernet). While the IP governs network protocol issues (e.g., addressing, routing, and datagram packaging), the TCP governs transport protocol issues. These issues include establishing, managing, and terminating connections; reliability; quality of service; flow control and congestion avoidance; and addressing/multiplexing.
In TCP, a connection is established between hosts with a 3-way handshake. The 3-way handshake involves an exchange of 3 messages between hosts. The TCP messages have the same structure, but will have either a SYN flag set, an ACK flag set, or both flags set. The flag defines the message. To initiate the 3-way handshake, a first host sends a synchronization message (SYN) to the second host. The SYN includes a sequence number field. The sequence number field indicates an initial sequence number (ISN=X) when set in a SYN message. The second host responds to the SYN with a SYN+ACK message (i.e., both the SYN flag and the ACK flag are set). This SYN+ACK message builds upon the SYN message and establishes the sequencing used for other features and functionality of TCP (e.g., reliability). The sequence number field of the SYN+ACK will have an ISN (Y) for the second host, while an acknowledgement number field of the SYN+ACK will have a number that is the sequence number expected by the second host to be received from the next message from the first host (X+1). This acknowledgement number is the sequence number from the SYN message incremented by one. In response to the SYN+ACK, the first host will respond with an ACK. This ACK from the first host may already carry data, whereas the previous messages did not. In addition, the ACK from the first host has a sequence number X+1 and an acknowledgement number Y+1. The connection is established after this ACK has been sent from the first host to the second host. A connection is identified with the addresses and ports of both hosts.
TCP also provides for a handshake exchange to close an established connection. Each side of a connection terminates independently. A first host sends a message with the FIN flag set to a second host of a connection. The second host acknowledges the FIN message with an ACK message. At this point, the connection is half-closed. When ready, the second host will send a FIN message to the first host. The first host then responds with an ACK. After the second host receives and processes the ACK from the first host in response to the second host's FIN message, the connection between the first and second hosts has been closed. This FIN handshake closes a connection in an ordered manner. TCP also provides a connection reset mechanism and defines a reset flag in the structure of a TCP message. A host will utilize the reset mechanism when an error is detected (e.g., receipt of a data message for a connection that is not open; receipt of a SYN+ACK for which a SYN was not sent). When a host receives RST, the host will abort the connection identified by the RST, possibly after checking the validity of the RST.